package com.pf.controller;

import com.pf.dto.BaseResult;
import com.pf.dto.response.CommodityRespDTO;
import com.pf.service.CommodityService;
import com.pf.utils.BaseResultUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author PanFei
 * @version 1.0.0
 * @createTime 2021/7/27
 */
@RestController
@RequestMapping("/commodity")
public class CommodityController {

    @Autowired
    private CommodityService commodityService;

    /**
     * 查询所有商品信息
     *
     * @return
     */
    @GetMapping("/all")
    public BaseResult<List<CommodityRespDTO>> getAllCommodityList() {
        return BaseResultUtils.success(commodityService.getAllCommodityList());
    }


}
